package com.tencent.wework.list

/**
 * Created by waylonhuang on 2019-05-30.
 */
fun BaseRecyclerCell<out Any>.preCell():BaseRecyclerCell<out Any>?{
    return adapter?.indexOf(this)?.takeIf { it>=0 }.let { adapter?.getItem(it?.minus(1)?:-1) }
}

fun BaseRecyclerCell<out Any>.nextCell():BaseRecyclerCell<out Any>?{
    return adapter?.indexOf(this)?.takeIf { it>=0 }.let { adapter?.getItem(it?.plus(1)?:-1) }
}